{% extends "links/base.html" %}
{% load staticfiles %}
{% load crispy_forms_tags %}

{% block title %}
{{ tag.name }}
{% endblock %}

{% block breadcrumb %}
<li><a href="{% url "home" %}">Home</a></li>
<li><a href="{% url "tag-index" %}">Tags</a></li>
<li class="current">{{ tag.name }}</li>
{% endblock %}

{% block content %}
  <div class="row">
    <div class="large-12 columns">
      <h1>Tag: {{ tag.name }}</h1>
      <div  class="js-masonry" data-masonry-options='{ "itemSelector": ".panel", "gutter": 10 }'>
        {% for link in links %}
        <div class="panel medium-3{% if link.pk in upvoted_pk %} panel-highlight{% endif %}">
          <h5><a href="{% url "link-single-slug" link.id link.slug %}">{{ link.title }}</a></h5>
          <ul class="inline inline-list">
            {% for tag2 in link.tags.all %}{% if tag2.name != tag.name %}
            <li><p class="tag left"><a href="{% url "tag-single-slug" tag2.slug %}"><span class="t">{{ tag2.name }}</span></a></p></li>
            {% endif %}{% endfor %}
          </ul>
        </div>
        {% endfor %}
      </div>
  </div>
</div>

{% endblock %}

{% block last_body %}
<script src="{% static "bower_components/masonry/dist/masonry.pkgd.min.js" %}"></script>
{% endblock %}
